// IPAddrConverter.h: interface for the IPAddrConverter class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_IPADDRCONVERTER_H__BDF910B1_6BDB_41FF_A201_1364A1AF1BD4__INCLUDED_)
#define AFX_IPADDRCONVERTER_H__BDF910B1_6BDB_41FF_A201_1364A1AF1BD4__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <afxsock.h>

class IPAddrConverter
{
protected:
	IPAddrConverter();
	virtual ~IPAddrConverter();

public:
	static bool IsValidString(const CString& strIPAddr);
	static CString FormatString(const CString& strIPAddr);

	static DWORD String2DWord(const CString& strIPAddr);
	static DWORD Struct2DWord(const IN_ADDR& in_addr);
	static CString DWord2String(DWORD dwAddr);
	static CString Struct2String(const IN_ADDR& in_addr);
	static IN_ADDR DWord2Struct(DWORD dwAddr);
	static IN_ADDR String2Struct(const CString& strIPAddr);
};

#endif // !defined(AFX_IPADDRCONVERTER_H__BDF910B1_6BDB_41FF_A201_1364A1AF1BD4__INCLUDED_)
